<!DOCTYPE html>
<head>

<script type="text/javascript">{
// Allow the page to be served from any directory...
const path  = location.pathname.replace(/index.html$/, '');
path.match(/\/$/) || window.location.replace(
	path+'/'+(location.search||'')
);
}</script>
<style type = "text/css">@import url(app.css)</style>
<script src = "app.js"></script>
<script src = "//ajaxorg.github.io/ace-builds/src-min/ace.js"></script>
<script>require('initialize');</script>
</head>
<script type = "text/php">
<?php
$window   = new \Vrzno;
$document = $window->document;

$h1 = $document->querySelector('h1');

$h1->addEventListener('click', function(){
	vrzno_run('alert', ['lmao!']);

	$h1->style;
});

// $console  = $window->console;
// $openFile = $document->getElementById('.openFile');
// $input    = $document->querySelector('.input  textarea');

// openFile.addEventListener('input', event =>{

// 	const reader = new FileReader();

// 	reader.onload = (event) => {
// 		editor.setValue(event.target.result);
// 	};

// 	reader.readAsText(event.target.files[0]);

// });


// $input = $document->querySelector('.input  textarea');

// $console->log('$console->log in PHP!');

?></script>

<!--
sssooo+++++++///////++++//:----:::::///////:::::::///+ossssssyyyhdddddmmmmNNmo`````````````````````-
soooo+//////::::::::////:-....-----::::::----------:/+ossyyyyhdhddmmmmNNMNNNN:                     .
soo++//:::---------:://::-----..------.-.........--:/+ossyyhddmmddmmNNNNMMNNm.                     .
ssoo+//:-----.....-:::::..................```.`..-::/+osyhdhdddmmmmmNMNMMNNNm`                     .
ssoo++:::----.....--:/:--.....--...--...`........--:/+osyhdddddmmmddNNNMNNNNd`                     .
sysso+///::--.....-::/:--....-------.-..........---:/+osyhhddmmNmmmmNNNNNNNNs                      .
syyssoo++++/+/::--:://:-...---::::::----------:::::///+syhmmNNNNmNNNNNMNNNNNs                      .
syssssoooooooo+/////++/:-.-:://///////::::--:::::///+osydddddmNNNNNNNNMNNNNN-                      .
yyssssssssooo+++++++o+/:--:/+//++///////::----:///++osyyysoshdNNNNNNNNNNNNNs`                      .
yhyyssssossoo+++ooo+++/:-::////+++++////:::-::://+oooo++/:/+ohmNNNNNNNNNNNh`                       .
yhyyssoooooo++/++////+:--::://+++++/::------::://++/////+///+sdNNNNNNNNmNd.                        .
ssysssooooo+////::::::-----:///:::---.....----::::::/++////++shdmmNNNNNNm.`                        .
sooo+//+++////::::-.......--:--....````......--:/+ooo+:--::/oshmNNNNNNNNo`                         .
sssso++/:/:::::::--.`````.....````````..`.--:////:::--..--:+syhmNNNNNNms`                          .
///+++++////:/::::-``````````````..---:-::::://:::-:///++++oshmNNNNmNho.                           .
+yhh/:+/-:/++/+///:-........```.-://+++/::+yhoosh+-ohhdmmmmmmmmmmNNNy-`-                           .
syhds/+/+ohmmdhyso/:-.----..``.-:+syhdmy/::oh++oyosyydmNNmmmmmmmmmNN/` `.                          .
hhhhyhhmmNNNNNNNNmhs+///:-..``-/ydNNNNNNmdyso++/+osyhhhhhhhhdmmmmmNd`                              .
yyysyyhhdmNNNNMMNNNmhsso+/::-.+hmNNmmmddhyso+/+//+oosssooosssymmmNN+`                              .
ooooossyhdddmNNNNNNmdyyso+++//yyhdmddhhyyso+//+oooooooosssyyhdhmNNm:.`                             .
ssssssyhhhhdmNmmNNmdhyyssssooshyyyhdddhyso+++++++++oo++oossyhmddNNy`                               .
ssyyyysssshdddmNNmmdhyyssssoosyyso+ooosyssoo+++/////+++ossyydmmmNN:                                .
sssossyyhhyysmNmdddhhyyssssoooshyo//++/+++++++++++ooooosssyhdmNNNd`                                .
ssssssyyyssyymmdhhhyyyssssoo+oosyyyyso++++++++oosssssssssyhddmNNNo                                 .
syysssyyyyyyhddhyyyyssssoo++///++syyssoo+/+++++ossssssssyyhdmNNNN:                                 .
sssoooooossyhdddhhhhyssooo+/////++++//:::--:--:///+oosssyhdmNNNNm.                                 .
+++/++++osssyyhmddddhyssso+++++++/::::------......--:/+syhdmNNNNd:.```      ````                   .
++ooooo+ohmNmmddmmddhhyyssooooso++oso+-....----..```.-:+yhdmNNNMNNmdhyyyyssshddhso/--..`           .
oooooo+ooodmmmmddmmdhhysssssssssoyso+:---....-:/:-.``.-/shdmNNNMMMMMMNNNNNNNNMMNMNNNNmdhys+/:-.``  .
syysssssosyhhdddddddhyysssossssssso//::://////++++/:---:shdmNNNMMMNNNNNMMMNNMNMMMNMMMMMNNNNNNmdhysoo
ssssssysssssshdddddhyyssoooooooooo/:///+ooooooooo+///o/+ydmmNNNMMMNMNNMMMMMMMMMMMMMMMMMNNMNNNNNNNNNd
hys++oyyyssoooyhhhhyyso++/+oooo++///+++ooooo++ss////+soshmNNNMMMMMMMNNMMMMMMMMMMMMMMMMMNMMNNNNNNNNNm
ydmdyooosssooooosyysso+/::::+++//++++oo++//+sys++++oosyhmNNNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNNNNNMNNNm
yhdmmmdhyoo+++oo++++/:.....-://++o++++/+oyhdyoosssssyhhmNNMMMMMMMNNMMMMMMMMNMMMMMMMMMMMMMMMNMMMMMMMm
hhyhmNNNNdyysso++///:-.`````--:///++osydmmdyossssssyddmNMMMMMMMMMMNMMMMMMNNMMMMNMMMMMMMMMMMMMMMMMNMm
hhysydNNNN+.-ossysso+//:/::://+ooo/:mNmmmhsssyssyyhdmmNNMMMMMMMMMMNMMMMMMNNNMMNNMMMMMMNMMNNNNNNNMNMm
hhyyyydmmmh-./``.///++oo+//::-.`-::smmmhsssyyyyyhhdNNNMMNNMMMMMMNMMMMMMNNNNMMMNNMMMMNNNMNNNNNNNNMMMm
hdhyyyyhmmhyyy:.`-`   `.   `-.`.shhdddyosyyyhyyhdmmNNNMNNNMMMMMNNMMNMMMMNNMNMMMMMMNNNMMMNNNmNNNNNNNm
dmdhyyssyhdhyyyysyo+//o+/:/oyysshdmdys+syyyyyhhdmmNmNMNNNNMMMMMNMNMMMMMNNNMMMMMMMMMMMMMNNNNNNNNNNMMm
mmmdhyysssyhhyyyssssssyyyyyhyyyyhhyo+oosysyshddmmmmmNMNNNNMMMNNNMMMMMMNNNNMMMMMNMNMMNMNNmmmNNNNNNNNm
mNNmdhhyyyyyssyyssssossysssysyyso+++osysssshhmNmmmmNNNNNNMMMNNMMMMMMMMNMMMMMMMNNNNMMNNNNmmmNNNNNNNMm
mNNmmdhdhhyyysossssysyyyyysooo+++osssssyyyhdNNddmdmNMMNNMMMNNNMMMNMMMMNMMNNMNNNNNNNNMNNmmmNNNNNNNNMm
dmNmmddhhhhhyyssssosooooooooooosoossyyyyyhdmmdddmmmNMNNNMMNNNNNMMMMMMMNMMMNNNNNNNNNNNNmmmmNNNNNNNMNm
hddmmmddhdhhhyyssssssssysssoooosyyyyyyhhhdddhmmdmmNMMNMNNNNmNNNMMMMNNNNMNMNNNNNNMNMNNmmmmmmNNNNNMMMm
ddhhddmdddhyyyyyyyssysssssssssyyyyyyhhddddhdmmNNNNNNNMMMNNmmNNNMNMMNNNNNNNNNNNNNNNNNmmdmmmmNNNNNNMMm
hdhhyydmmdhhyhyyyyyssyysssssyysyyyhhhdmdhydNNNNNNMMNNMNNNmmmNNNMNNNNmmNNNNNNNNNNNNNNmmddmmNNmNNNMMNm
yhyysosshhddhdhyyyssssyyyyyyyysyyyhdmdyyhdNNNNNMMNNNNMMNmmmmmNNMNNNmmmNNNNNNNNNNNNNmmddmmmNNmNNMMNNd
yssooooo+oydddyhyhhyyyyysyhyhhyhhyyhssshdNNNMMMMNNNNMNNNmdhmmNNMNmmddmmNNNNNNNNMNNNmdhddmmNmNNNMNNNh
sso+++++++++oyhdddddyhhhyyhhdddhho++oyhdmNNNMMMNNNNNNNNmdhhmNNNNNmhddmmNNNmNNNNNNNmddddmmmmNNNNNNNmh
sso++++++///++//oyyyyhhhyyyyssoo+++syhhhdmNNNNmmmmmmmmdhhyhmNNNmddhhddmmmmmmmmNmNmmdhhhdddmmmmNNmmdy
-->
<title>php-wasm</title>
<body>
	<div class = "row header toolbar">
		<div class = "cols">
			<div class = "row start">
				<a target = "_blank" href = "https://github.com/oraoto/pib">
					<img class = "round" src = "oraoto-icon.png" />
				</a>
				<a target = "_blank" href = "https://github.com/seanmorris/php-wasm">
					<img src = "sean-icon.png" />
				</a>
				<h1>php-wasm</h1>
				<hr />
				<select data-select-demo>
					<option value>Select a Demo</option>
					<option value = "hello-world.php">Hello, World!</option>
					<option value = "phpinfo.php">phpinfo();</option>
					<option value = "persistent-memory.php">Persistent Memory</option>
					<option value = "dom-access.php">DOM Access</option>
					<option value = "goto.php">GoTo</option>
					<option value = "stdio.php">StdOut, StdIn, & Return</option>
					<option value = "sqlite.php">SQLite</option>
					<option value = "sqlite-pdo.php">SQLite (PDO)</option>
					<option value = "json.php">JSON</option>
					<option value = "closures.php">Closures</option>
					<option value = "files.php">Files</option>
					<option value = "zend-benchmark.php">Zend Benchmark</option>
					<option value = "drupal.php">Drupal 7</option>
				</select>
				<button data-load-demo>load</button>
			</div>
		</div>
		<div class = "separator">
		</div>
		<div class = "row rows collapse">
			<label>
				<span>text</span>
				<input value = "text" type = "radio" name = "render-as" checked />
			</label>
			<label>
				<span>html</span>
				<input value = "html" type = "radio" name = "render-as" />
			</label>
		</div>
		<div class = "row rows collapse">
				<label>
					<span>Persist Memory</span>
					<input type = "checkbox" id = "persist" />
				</label>
				<label>
					<span>Single Expression</span>
					<input type = "checkbox" id = "singleExpression" />
				</label>
				<label>
					<span>Autorun</span>
					<input type = "checkbox" id = "autorun" />
				</label>
			</div>
		<button data-run disabled>run</button>
		<!-- <button data-tokenize>parse</button> -->
	</div>

	<div class = "row body">
		<div class = "panel">
			<div class = "input">
				<div class = "cols">
					<label tabindex="-1">
						<img src = "php.png"> <span>PHP Code</span>
					</label>
					<label id = "openFile" class = "collapse"tabindex="-1">
						open file<input type = "file" accept=".php" >
					</label>

				</div>
				<textarea></textarea>
			</div>
		</div>

		<div class = "panel">
			<div id = "ret">
				<div class = "cols">
					<label tabindex="-1">return</label>
				</div>
				<div class = "stdret output liquid">
					<div class = "column">
						<iframe class = "scroller" srcdoc=""></iframe>
						<div class = "scroller"></div>
					</div>
				</div>
			</div>
			<div>
				<div class = "cols">
					<label tabindex="-1">stdout</label>
					<label id = "exit" class = "collapse" tabindex="-1">exit code: <span></span></label>
				</div>
				<div class = "stdout output liquid">
					<div class = "column">
						<iframe sandbox = "allow-same-origin allow-scripts allow-forms" class = "scroller" srcdoc=""></iframe>
						<div class = "scroller"></div>
					</div>
				</div>
			</div>
			<div>
				<div class = "cols">
					<label tabindex="-1">stderr</label>
				</div>
				<div class = "stderr output liquid">
					<div class = "column">
						<iframe class = "scroller" srcdoc=""></iframe>
						<div class = "scroller"></div>
					</div>
				</div>
			</div>
		</div>
	</div>

	<div class = "row status toolbar">
		<div>
			<div class = "row start" data-status>
				php-wasm
			</div>
		</div>
		<div>
		</div>
	</div>
</body>

